﻿using System;
using System.Web.UI;

namespace BigLotterySyndicate.Classes
{
    public class TitleTag : BaseUserControl
    {
        public override void RenderControl(HtmlTextWriter writer)
        {
            String title = Properties.Settings.Default.SiteName;

            try
            {

                if (this.BasePage != null)
                {
                    if (this.BasePage.PageTitle != null)
                        title += " | " + this.BasePage.PageTitle.ToString();
                }
                else
                {
                    if (this.BasePublicPage.PageTitle != null)
                        title += " | " + this.BasePublicPage.PageTitle.ToString();
                }


                writer.Write(title);

            }

            catch { }

            base.RenderControl(writer);

        }
    }
}